Skip to main content
Version: 1.0.8

LightGBM

LightGBMClassifier

from synapse.ml.lightgbm import *

lgbmClassifier = (LightGBMClassifier()
.setFeaturesCol("features")
.setRawPredictionCol("rawPrediction")
.setDefaultListenPort(12402)
.setNumLeaves(5)
.setNumIterations(10)
.setObjective("binary")
.setLabelCol("labels")
.setLeafPredictionCol("leafPrediction")
.setFeaturesShapCol("featuresShap"))
Python API: LightGBMClassifierScala API: LightGBMClassifierSource: LightGBMClassifier

LightGBMRanker

from synapse.ml.lightgbm import *

lgbmRanker = (LightGBMRanker()
.setLabelCol("labels")
.setFeaturesCol("features")
.setGroupCol("query")
.setDefaultListenPort(12402)
.setRepartitionByGroupingColumn(False)
.setNumLeaves(5)
.setNumIterations(10))
Python API: LightGBMRankerScala API: LightGBMRankerSource: LightGBMRanker

LightGBMRegressor

from synapse.ml.lightgbm import *

lgbmRegressor = (LightGBMRegressor()
.setLabelCol("labels")
.setFeaturesCol("features")
.setDefaultListenPort(12402)
.setNumLeaves(5)
.setNumIterations(10))
Python API: LightGBMRegressorScala API: LightGBMRegressorSource: LightGBMRegressor